﻿using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;

public partial class BossListScene : Scene
{
	public string DatetimeToString(long dateGap)
	{
		DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
		DateTime targetDate = startDate.AddMilliseconds(dateGap).ToLocalTime();
		return targetDate.Year.ToString();
	}
	
	public string DatetimeToFomattedString(long dateGap)
	{
		//DateTime nowDate = DateTime.Now;		
		DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
		DateTime nowDate = startDate.AddMilliseconds(serverTime).ToLocalTime();
		DateTime targetDate = startDate.AddMilliseconds(dateGap).ToLocalTime();
		
		TimeSpan ts = nowDate - targetDate;
		
		if (ts.Days >= 1)
		{
			return ts.Days.ToString() + "일" + ts.Hours.ToString() + "시간 " + ts.Minutes.ToString() + "분 남음";
		}
		else if (ts.Hours > 0)
		{
			return ts.Hours.ToString() + "시간 " + ts.Minutes.ToString() + "분 남음";
		}
		else
		{
			return ts.Minutes.ToString() + "분 남음";
		}
	}
}
